<?php
    
    
    Class FileUploadController{
    	
		function DoControll($aFileUploadView, $aFileUploadHandler, $aIsLoggedIn){
			
			$ret = NULL;
			if($aFileUploadView->DidUserUpload()){
				$file = $aFileUploadView->GetUploadedFile();
				
				if($aFileUploadHandler->DoUpload($file)){
					$ret .= $aFileUploadView->AddMessageFileUploaded();
				}
				else{
					$ret .= $aFileUploadView->AddMessageFileUploadFail();
				}
			}
			
			if($aIsLoggedIn){
				$ret .= $aFileUploadView->DoUploadBox();
			}
			$ret .= $aFileUploadView->ShowFiles();
			
			return $ret;
		}
    }
